#!/usr/bin/env python
#
# Deleting elements from a list

zoo = ["monkey", "tiger", "eagle", "parrot"]
print "The zoo has the following", len(zoo), "animals:", zoo

number = input("Which animal would you like to delete? \
Input the number of the animal: ")
if 0 <= number < len(zoo):
      del zoo[number]
else:
      print "That number is out of range!"
print "The zoo has the following", len(zoo), "animals:", zoo

new_animal = raw_input("Which animal would you like to delete? \
Input the name of the animal: ")
if new_animal in zoo:
      zoo.remove(new_animal)
      print new_animal, "has been deleted"
else:
      print new_animal, "cannot be deleted because it is not in the zoo"
print "The zoo has the following", len(zoo), "animals:", zoo
